home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK2.toast / Development Kits (Disc 2) / QuickTime™ VR 2.0 SDK / QTVR C⁄C++ Runtime API / Sample Code / VRShell Sample Code / Common Files / Mac Framework / MacMain.c < prev   
Encoding:
Text File  |  1997-05-22  |  1.6 KB  |  70 lines  |  [TEXT/MPCC]

  1. //
  2. //    File:        MacMain.c
  3. //
  4. //    Contains:    Simple Macintosh shell for testing QuickTime VR.
  5. //
  6. //    Written by:    Tim Monroe
  7. //                Based (heavily!) on the MovieShell code written by Apple DTS
  8. //
  9. //    Copyright:    © 1994-1996 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //    Change History (most recent first):
  12. //
  13. //       <2>         11/27/96    rtm        conversion to personal coding style
  14. //       <1>         12/20/94    khs        first file
  15. //       
  16. //
  17. //    TODO:        (1) 
  18.  
  19. // header files
  20. #include <stdio.h>
  21. #ifdef __MWERKS__
  22. #include <sioux.h>
  23. #endif // __MWERKS__
  24.  
  25. #include "DTSQTUtilities.h"
  26. #include "MacFramework.h"
  27.  
  28. //////////
  29. //
  30. // main
  31. // set up the app's execution environment; make sure QuickTime (etc.) is installed
  32. //
  33. //////////
  34.  
  35. void main (void)
  36. {
  37.     OSErr        myErr = noErr;
  38.  
  39. // this is for controlling the sioux window under Metrowerks (5.0 forward)
  40. #ifdef USESIOUX    
  41.     SIOUXSettings.initializeTB = false;
  42.     SIOUXSettings.setupmenus = false;
  43.     SIOUXSettings.autocloseonquit = true;
  44. #endif //USESIOUX    
  45.  
  46.     InitStack(10*1024L);            // add 10k more to the stack, for possible QD and Sound Manager needs
  47.     InitMacEnvironment(10L);        // 10 * MoreMasters
  48.     InitMenubar();
  49.     
  50.     if (!QTUIsQuickTimeInstalled()) {
  51.         ShowWarning("\pThe QuickTime extension is not present in this system", 0);
  52.         ExitToShell();
  53.     }
  54.  
  55. #if powerc    
  56.     if (!QTUIsQuickTimeCFMInstalled()) {
  57.         ShowWarning("\pThe QuickTime PowerPlug extension is not available (exit)", 0);
  58.         ExitToShell();
  59.     }
  60. #endif 
  61.  
  62.     myErr = EnterMovies(); DebugAssert(myErr == noErr);
  63.     if (myErr != noErr) {
  64.         ShowWarning("\pCould not initialize the QuickTime environment (exit): ", myErr);
  65.         ExitToShell();
  66.     }
  67.  
  68.     MainEventLoop();
  69. }
  70.